/**
 * Copyright (C) 2020 Baidu, Inc. All Rights Reserved.
 */
package com.baidu.mpks.dal.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author cuixuefei
 *
 */
@Data
public class DataSourceBase {
    private Integer id;
    @NotBlank(message = "{DataSourceBase.name.empty}")
    @Length(message = "{DataSourceBase.name.length}", min = 1, max = 50)
    private String name;

    // 0启用，1停用
    private Integer state;

    // 0未删除，1已删除
    private Integer isDelete;

    @Length(message = "{DataSourceBase.comment.length}", min = 0, max = 200)
    private String comment;

    private List<String> distributeType;

    private String contentType;

    private Integer parentDatasourceId;
    private String produceType; // irqa_mining, faq_import, faq_mining
    private List<String> faqSearchType; // custom_search_keyword, search_log
    private String searchType;

    private Integer taskId;
    private String hdfsPath;

    private List<Integer> nodeIds;
    private List<Integer> searchKeywordNodeIds;
    private List<Map<String, Object>> nodeIdsMap;
    private List<Map<String, Object>> searchKeywordNodeIdsMap;
    private String createBy;
    private String trueName;
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateStateTime;
    // 0初始化 1成功 -1失败
//    private int status;

    private String type;
    // 0不可见 1可见
    private int showable;
    // 是否可编辑 0不编辑 1可编辑
    private int edit;
    // 是否可删除 0不可删除 1可删除
    private int delete;

    private String totalKnowledge;

    private String pushType;

    private Integer dagId;
}
